/* global AFRAME, THREE */
AFRAME.registerComponent('battle-button', {
    schema: {
        time: { type: "number", default: 10 },
    },

    init: function () {
        const self = this;
        const el = self.el;
        // 这里可能会出错，如果组件在文档加载之前加载的话

        this.getRandomArbitrary = getRandomArbitrary;

        this.setAnimatedColor = function () {
            // if (shootGameLock === false) {
                // console.log('setAnimatedColor');
                el.emit('setAnimatedColor');
            // }

        },
            this.setAnimation = function () {
                // if (shootGameLock === false) {
                    // console.log('Got hit!scaleUp!');
                    el.emit('scaleUp');
                // }
            },
            el.addEventListener('collide', self.setAnimation);
        el.addEventListener('collide', self.setAnimatedColor);
    },

});
